import request from '@/utils/request'

// 连接无人机
export function connectDrone() {
  return request({
    url: '/system/drone/connect',
    method: 'post'
  })
}

// 断开无人机连接
export function disconnectDrone() {
  return request({
    url: '/system/drone/disconnect',
    method: 'post'
  })
}

// 开始无人机任务
export function startDroneMission(data) {
  return request({
    url: '/system/drone/mission/start',
    method: 'post',
    data: data
  })
}

// 停止无人机任务
export function stopDroneMission() {
  return request({
    url: '/system/drone/mission/stop',
    method: 'post'
  })
}

// 获取任务状态
export function getMissionStatus() {
  return request({
    url: '/system/drone/mission/status',
    method: 'get'
  })
}

// 获取无人机状态
export function getDroneStatus() {
  return request({
    url: '/system/drone/status',
    method: 'get'
  })
}

// 获取任务报告
export function getMissionReport(missionId) {
  return request({
    url: '/system/drone/mission/report/' + missionId,
    method: 'get'
  })
}

// 查询无人机任务列表
export function listMission(query) {
  return request({
    url: '/system/drone/mission/history',
    method: 'get',
    params: query
  })
}

// 查询无人机任务详细
export function getMission(missionId) {
  return request({
    url: '/system/drone/mission/' + missionId,
    method: 'get'
  })
}

// 新增无人机任务
export function addMission(data) {
  return request({
    url: '/system/drone/mission',
    method: 'post',
    data: data
  })
}

// 修改无人机任务
export function updateMission(data) {
  return request({
    url: '/system/drone/mission',
    method: 'put',
    data: data
  })
}

// 删除无人机任务
export function delMission(missionId) {
  return request({
    url: '/system/drone/mission/' + missionId,
    method: 'delete'
  })
}

// 导出无人机任务
export function exportMission(query) {
  return request({
    url: '/system/drone/mission/export',
    method: 'get',
    params: query
  })
}

// 获取图片信息
export function getImagesInfo() {
  return request({
    url: '/system/drone/mission/images/info',
    method: 'get'
  })
}

// 测试连接
export function testConnection() {
  return request({
    url: '/system/drone/test/connection',
    method: 'get'
  })
}

// 测试无人机状态
export function testDroneStatus() {
  return request({
    url: '/system/drone/test/droneStatus',
    method: 'get'
  })
}
